var express = require('express');
var router = express.Router();

const {
  findNewsList,
  insert,
  updateNews,
  delById
} = require("../controller/news");
const { authFilter } = require("../middlewares/auth");

class NewsRouter {
  static initRouter() {
    router.get('/', authFilter, findNewsList);
    router.put('/:id', authFilter, updateNews);
    router.post('/insert', authFilter, insert);
    router.delete('/:id', authFilter, delById);
    return router;
  }
}
module.exports = NewsRouter.initRouter();